FROM kylin-server-10-sp3b20-x86_64-20221125:b21

LABEL maintainer="BES"

ARG WEBSERVER_TAR_FILE='./BES-WEBSERVER-STANDALONE-3.1.0.1106-KYLIN10-X64.tar.gz'

WORKDIR /home/bes/BWS

ENV JAVA_HOME /usr/java/jdk1.8.0_232

COPY pkgs/*.rpm /opt/bes/
RUN rpm -iv --replacepkgs /opt/bes/fontpackages-filesystem-1.44-8.el7.noarch.rpm
RUN rpm -iv --replacepkgs /opt/bes/dejavu-fonts-common-2.33-6.el7.noarch.rpm
RUN rpm -iv --replacepkgs /opt/bes/dejavu-sans-fonts-2.33-6.el7.noarch.rpm
RUN rpm -iv --replacepkgs /opt/bes/libpng-1.5.13-8.el7.x86_64.rpm --force
RUN rpm -iv --replacepkgs /opt/bes/freetype-2.8-14.el7_9.1.x86_64.rpm
RUN rpm -iv --replacepkgs /opt/bes/fontconfig-2.13.0-4.3.el7.x86_64.rpm
RUN rpm -iv --replacepkgs /opt/bes/net-tools-2.0-0.24.20131004git.el7.x86_64.rpm

ADD ${WEBSERVER_TAR_FILE} .
ADD ./application.yml ./conf
ADD ./run.sh .
ADD OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz  /usr/java
RUN groupadd nobody && usermod -a -G nobody nobody;chmod +x ./run.sh

EXPOSE 5900

CMD ["/home/bes/BWS/run.sh"]
